Food Carbon Footprint

As more information is available regarding the impact of carbon emissions on climate change, it is easier to see how our lifestyles impact our carbon footprint. These lifestyle choices range from our commute to what we have for lunch. These choices vary by country, culture, and individual. The carbon footprint of the average consumption by food group has been calculated for at least 130 countries. These calculations are based on food balance sheets and population data available from the Food and Agriculture Organization of the United Nations (FAO). These visualizations intend to compare the dietary sources of CO2 of non-animal based products to animal-based products and the differences in the food production across countries.

initial <- import(here("data", "food_carbon_footprint_data.xlsx")) %>% 
  clean_names() %>%
    as_tibble()

subset <- initial %>% 
  mutate(ranking = as.numeric(ranking)) %>% 
  filter(ranking < 7 |country == "all"| country =="Canada"|country =="Japan"
         |country == "Germany"|country =="Mexico"|country =="South Korea"|country =="China")

#line plot work: CO2/person/year produced by country

initial_longer <- subset %>%
  select("ranking", "country","total_animal_products", "total_nonanimal_products", 
         "animal_nonanimal_difference") %>% 
  pivot_longer(cols = 3:5,
               names_to = "product",
               values_to = "CO2_person_year")

nadiff <- subset %>%
  arrange(desc(animal_nonanimal_difference)) %>% 
  select("ranking", "country", "animal_nonanimal_difference") %>% 
  pivot_longer(cols = 3,
               names_to = "product",
               values_to = "CO2_person_year")

animal <- subset %>%
  pivot_longer(cols = 3:9,
               names_to = "product",
               values_to = "CO2_person_year")

non_animal <- subset %>%
  pivot_longer(cols = 11:14,
               names_to = "product",
               values_to = "CO2_person_year")

Plots - Initial Draft

  #plot1: animal products
#draft

a1 <- animal %>% 
  ggplot(aes(product, CO2_person_year, group=country)) +
  geom_line(aes(color = country))
a1

  #plot2: non-animal products
#draft
na1 <- non_animal %>% 
  ggplot(aes(product, CO2_person_year, group=country)) +
  geom_line(aes(color = country))
na1

  #plot3: difference between animal and non-animal products
#draft
d1 <- nadiff %>% 
  ggplot(aes(CO2_person_year, country)) +
  geom_col(aes(fill = country))
d1

Animal Products

  #plot1: animal products
a2 <- animal %>% 
  ggplot(aes(product, CO2_person_year, group=country)) +
  geom_line(aes(color = country), size = 1) +
  gghighlight(country == "all" |country == "USA" | country =="Canada"| country =="Japan") +
  scale_color_viridis_d() +
  scale_x_discrete(expand = c(0, 0)) +
  labs(title = "CO2/person/year for animal products",
       subtitle = "",
       x = "animal product",
       y = "Co2/person/year (in Kg)") +
  theme_minimal()
ggplotly(a2, tooltip = c("country","product","CO2_person_year"))

Non-Animal Products

  #plot2: non-animal products
#final
na2 <- non_animal %>% 
  ggplot(aes(product, CO2_person_year, group=country)) +
  geom_line(aes(color = country), size = 1) +
  gghighlight(country == "all" |country == "USA" | country =="Canada"| country =="Japan") +
  scale_color_viridis_d() +
  scale_x_discrete(expand = c(0, 0)) +
  labs(title = "CO2/person/year for non-animal products",
       subtitle = "",
       x = "non-animal product",
       y = "Co2/person/year (in Kg)") +
  theme_minimal()
ggplotly(na2, tooltip = c("country","product","CO2_person_year"))

Animal/Non-Animal Difference

Difference between the CO2 production of animal product and non-animal product, over a year. A low value means that a larger proportion of the population feeds on plant products which have a better carbon emission footprint.

  #plot3: difference between animal and non-animal products
#final

d2 <- nadiff %>% 
  ggplot(aes(CO2_person_year, reorder(country, CO2_person_year))) +
  geom_col(aes(fill = country)) +
  geom_col(data = filter(nadiff, country == "all" |country == "USA"),
           fill = "#C55644") + 
  scale_fill_viridis_d() +
  labs(title = "Animal v. Non-Animal Products difference",
       subtitle = "",
       x = "Co2/person/year (Kg)",
       y = "") +
  theme_minimal() +
  theme(legend.position = "none")
ggplotly(d2, tooltip = c("CO2_person_year"))